package com.app.designpatternslearn.behavior.iteratorpattern

import com.app.designpatternslearn.behavior.iteratorpattern.code.SubContainer

fun main() {

    val subContainer = SubContainer<String>()
    subContainer.addElement("hahahaha")
    subContainer.addElement("1111")
    subContainer.addElement("2222")
    subContainer.addElement("haha333haha")
    subContainer.addElement("hahah55555aha")

    val iterator = subContainer.getIterator()

    while (iterator.hasNext()) {
        val str = iterator.next()

        println("数据项：$str")
    }
}